<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.jd.ty.pojo">
	<class name="CustomerCompany" table="CUSTOMER_COMPANY"
		schema="TYMS">
		<id name="custCompanyId" type="java.lang.Long">
			<column name="CUSTOMER_COMPANY_ID" precision="10" scale="0" />
			<generator class="identity" />
		</id>
		<property name="custCompanyName" type="java.lang.String">
			<column name="CUSTOMER_COMPANY_NAME" length="20"
				not-null="true" />
		</property>
		<property name="address" type="java.lang.String">
			<column name="ADDRESS" length="200" not-null="true" />
		</property>
		<property name="postalCode" type="java.lang.String">
			<column name="POSTAL_CODE" length="10" not-null="true" />
		</property>
		<property name="faxNumber" type="java.lang.String">
			<column name="FAX_NUMBER" length="20" />
		</property>
		<property name="phoneNumber" type="java.lang.String">
			<column name="PHONE_NUMBER" length="50" />
		</property>
		<bag name="customers" fetch="select" cascade="all"  inverse="true"
			lazy="false">
			<key column="CUSTOMER_COMPANY_ID" />
			<one-to-many class="com.jd.ty.pojo.Customer" />
		</bag>
		<bag name="appreciationLog" fetch="select" cascade="all"  inverse="true"
			lazy="false">
			<key column="CUSTOMER_COMPANY_ID" />
			<one-to-many class="CustomerAppreciationLog" />
		</bag>

		<property name="firstOrderTime" type="timestamp">
			<column name="FIRST_ORDER_TIME" />
		</property>
		<property name="lastOrderTime" type="timestamp">
			<column name="LAST_ORDER_TIME" />
		</property>
	</class>
</hibernate-mapping>
